package model.environment;

/**
 * Project : Leertaak 4 Mobile Robot Explorer
 * Package : model
 *
 * User: Dustin Meijer
 * Date: 13-12-12
 * Time: 21:55
 */
public class LaserMeasurement {

    protected double distance;
    protected double direction;

    protected LaserMeasurement(double distance, double direction){
        this.set(distance, direction);
        this.processDirectionValue();
    }

    protected void set(double distance, double direction) {
        this.distance = distance;
        this.direction = direction;
    }


    private void processDirectionValue(){
        while (direction >= 2.0 * Math.PI)
            direction -= 2.0 * Math.PI;
        while (direction < 0.0)
            direction += 2.0 * Math.PI;
    }

}
